package com.example.myapplication.ViewModel

import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.lifecycle.ViewModel
import com.example.myapplication.model.entity.VideoEntity

class VideoViewModel : ViewModel() {
    var list = listOf(
        VideoEntity(
            "隔夜冰西瓜能否切掉表层后食用",
            "实时热点",
            "00:20:09",
            "https://img1.baidu.com/it/u=3081805172,1144788446&fm=253&fmt=auto&app=138&f=JPEG?w=650&h=344"
        ),
        VideoEntity(
            "耐克市值一夜蒸发800多亿",
            "实时热点",
            "00:20:09",
            "https://img2.baidu.com/it/u=1606747414,4238112605&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=623"
        ),
        VideoEntity(
            "鹿晗起诉炸鸡店侵权获赔5000元",
            "实时热点",
            "00:20:09",
            "https://img1.baidu.com/it/u=1547932861,343479369&fm=253&fmt=auto&app=120&f=JPEG?w=640&h=427"
        ),
        VideoEntity(
            "baby方回应热狗新歌歌词",
            "实时热点",
            "00:20:09",
            "https://img1.baidu.com/it/u=427580989,1530131917&fm=253&fmt=auto&app=138&f=JPEG?w=640&h=480"
        ),
        VideoEntity(
            "赵丽颖回复林更新说狗子别闹了",
            "实时热点",
            "00:20:09",
            "https://img0.baidu.com/it/u=898248108,1222124860&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=303"
        ),
        VideoEntity(
            "女子曝花6千元在SKP买到二手鞋",
            "实时热点",
            "00:20:09",
            "https://img2.baidu.com/it/u=1716796725,3022258492&fm=253&fmt=auto&app=138&f=PNG?w=640&h=346"
        )
    )
        private set

    var videoUrl by mutableStateOf("https://klxxcdn.oss-cn-hangzhou.aliyuncs.com/histudy/hrm/media/bg1.mp4")
        private set

    private val htmlHeader = """
        <!DOCTYPE html>
        <html>
        <head>
        	<meta charset="utf-8">
        	<meta name="viewport" content="width=device-width, initial-scale=1">
        	<title></title>
<style type="text/css">
		img {
			max-width: 100!important;
		}
	</style>
        </head>
        <body>
    """.trimIndent()

    private val htmlFooter = """
        </body>
        </html>
    """.trimIndent()



    private var videoTitle by mutableStateOf("这是视频标题")
     var videoDesc by mutableStateOf("""${htmlHeader}
         <h5 style="font-size: 32px;color:#333">$videoTitle</h5>
        <img alt="Gitee — 基于 Git 的代码托管和研发协作平台" class="ui inline black image" height="28" src="https://gitee.com/static/images/logo-black.svg?t=158106664" title="Gitee — 基于 Git 的代码托管和研发协作平台" width="95">
        <p style="font-size:14pt; line-height:150%; margin:0pt; orphans:0; text-align:center; widows:0">
      <span style="font-family:仿宋; font-size:14pt; font-weight:bold">会员积分说明</span></p>
    <p style="font-size:14pt; line-height:150%; margin:0pt; orphans:0; text-align:justify; widows:0"><span
        style="font-family:仿宋; font-size:14pt">一、积分政策是务本科技回馈会员用户的举措，只有成为务本科技</span><span
        style="font-family:仿宋; font-size:14pt">会员</span><span style="font-family:仿宋; font-size:14pt">后才能享有积分及权益</span>
         <img alt="Gitee — 基于 Git 的代码托管和研发协作平台" class="ui inline black image" height="28" src="https://gitee.com/static/images/logo-black.svg?t=158106664" title="Gitee — 基于 Git 的代码托管和研发协作平台" width="95">
        <p style="font-size:14pt; line-height:150%; margin:0pt; orphans:0; text-align:center; widows:0">
      <span style="font-family:仿宋; font-size:14pt; font-weight:bold">会员积分说明</span></p>
    <p style="font-size:14pt; line-height:150%; margin:0pt; orphans:0; text-align:justify; widows:0"><span
        style="font-family:仿宋; font-size:14pt">一、积分政策是务本科技回馈会员用户的举措，只有成为务本科技</span><span
        style="font-family:仿宋; font-size:14pt">会员</span><span style="font-family:仿宋; font-size:14pt">后才能享有积分及权益</span>
         <img alt="Gitee — 基于 Git 的代码托管和研发协作平台" class="ui inline black image" height="28" src="https://gitee.com/static/images/logo-black.svg?t=158106664" title="Gitee — 基于 Git 的代码托管和研发协作平台" width="95">
        <p style="font-size:14pt; line-height:150%; margin:0pt; orphans:0; text-align:center; widows:0">
      <span style="font-family:仿宋; font-size:14pt; font-weight:bold">会员积分说明</span></p>
    <p style="font-size:14pt; line-height:150%; margin:0pt; orphans:0; text-align:justify; widows:0"><span
        style="font-family:仿宋; font-size:14pt">一、积分政策是务本科技回馈会员用户的举措，只有成为务本科技</span><span
        style="font-family:仿宋; font-size:14pt">会员</span><span style="font-family:仿宋; font-size:14pt">后才能享有积分及权益</span>
         <img alt="Gitee — 基于 Git 的代码托管和研发协作平台" class="ui inline black image" height="28" src="https://gitee.com/static/images/logo-black.svg?t=158106664" title="Gitee — 基于 Git 的代码托管和研发协作平台" width="95">
        <p style="font-size:14pt; line-height:150%; margin:0pt; orphans:0; text-align:center; widows:0">
      <span style="font-family:仿宋; font-size:14pt; font-weight:bold">会员积分说明</span></p>
    <p style="font-size:14pt; line-height:150%; margin:0pt; orphans:0; text-align:justify; widows:0"><span
        style="font-family:仿宋; font-size:14pt">一、积分政策是务本科技回馈会员用户的举措，只有成为务本科技</span><span
        style="font-family:仿宋; font-size:14pt">会员</span><span style="font-family:仿宋; font-size:14pt">后才能享有积分及权益</span>
         <img alt="Gitee — 基于 Git 的代码托管和研发协作平台" class="ui inline black image" height="28" src="https://gitee.com/static/images/logo-black.svg?t=158106664" title="Gitee — 基于 Git 的代码托管和研发协作平台" width="95">
        <p style="font-size:14pt; line-height:150%; margin:0pt; orphans:0; text-align:center; widows:0">
      <span style="font-family:仿宋; font-size:14pt; font-weight:bold">会员积分说明</span></p>
    <p style="font-size:14pt; line-height:150%; margin:0pt; orphans:0; text-align:justify; widows:0"><span
        style="font-family:仿宋; font-size:14pt">一、积分政策是务本科技回馈会员用户的举措，只有成为务本科技</span><span
        style="font-family:仿宋; font-size:14pt">会员</span><span style="font-family:仿宋; font-size:14pt">后才能享有积分及权益</span>
         <img alt="Gitee — 基于 Git 的代码托管和研发协作平台" class="ui inline black image" height="28" src="https://gitee.com/static/images/logo-black.svg?t=158106664" title="Gitee — 基于 Git 的代码托管和研发协作平台" width="95">
        <p style="font-size:14pt; line-height:150%; margin:0pt; orphans:0; text-align:center; widows:0">
      <span style="font-family:仿宋; font-size:14pt; font-weight:bold">会员积分说明</span></p>
    <p style="font-size:14pt; line-height:150%; margin:0pt; orphans:0; text-align:justify; widows:0"><span
        style="font-family:仿宋; font-size:14pt">一、积分政策是务本科技回馈会员用户的举措，只有成为务本科技</span><span
        style="font-family:仿宋; font-size:14pt">会员</span><span style="font-family:仿宋; font-size:14pt">后才能享有积分及权益</span>
    </p>${htmlFooter}
    """.trimIndent())
}